#include "stm32f10x.h"     
#include "delay.h"
#include "key.h"
#include "led.h"
#include "pwm.h"
#include "oled.h"
#include "servo.h"

uint8_t keyCode;
float angle;

int main()
{
	OLED_Init();
	Servo_Init();
	Key_Init();
	OLED_ShowString(1,1,"angle:");



	
while(1){	
	keyCode = Key_GetKeyCode();
// 按键按下时，设置递增30度
	if(keyCode==1) 
	{	
		angle+=30;
		if(angle>180) angle=0;
		OLED_ShowNum(1,7,angle,3);
		ServoSetAngle(angle);
	}


}
}


















